package com.guoju.tyframework.mvcTest;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.guoju.tyframework.mvc.action.Action;
import com.guoju.tyframework.mvc.config.MvcBeans;


public class MyAction implements Action {

	@Override
	public String execute(MvcBeans actionBean, Map<String, String> actionResut, HttpServletRequest req,
			HttpServletResponse resp) {
		String url="no";
		if("123".equals(form.getName())){
			url="yes";
		}
		System.out.println("----我执行了execute方法---");
		return actionResut.get(url);
	}
	
	private MyForm form;
	private TestForm testForm;

	public TestForm getTestForm() {
		return testForm;
	}

	public void setTestForm(TestForm testForm) {
		this.testForm = testForm;
	}

	String name;
	String pw;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPw() {
		return pw;
	}

	public void setPw(String pw) {
		this.pw = pw;
	}
	
	
	public MyForm getForm() {
		return form;
	}

	public void setForm(MyForm form) {
		this.form = form;
	}

	@Override
	public String toString() {
		String a="name:"+name+"--pw:"+pw+"\r\n--form:"+form+"\r\n---testForm:"+testForm;
		return a;
	}


	
}
